//
//  STALogSetting.h
//  STALog
//
//  Created by jerry on 2019/5/5.
//  Copyright © 2019 jerry. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, STALogLevel){
    // 关闭打印日志
    STALogLevelOff       = 0,
    // 打印错误日志
    STALogLevelError     = (1 << 0),
    // 打印警告日志
    STALogLevelWarn      = (1 << 1),
    // 打印调试日志
    STALogLevelDebug     = (1 << 3),
    // 打印其他日志
    STALogLevelOther     = (1 << 4),
    // 打印所有日志
    STALogLevelAll       = NSUIntegerMax
};

#ifdef DEBUG

#define STALogOther if (ogaLogLevel & STALogLevelOther) STALogNSLog
#define STALogDebug if (ogaLogLevel & STALogLevelDebug) STALogNSLog
#define STALogWarn if (ogaLogLevel & STALogLevelWarn) STALogNSLog
#define STALogError if (ogaLogLevel & STALogLevelError) STALogNSLog

#else

#define STALogOther(...)
#define STALogDebug(...)
#define STALogWarn(...)
#define STALogError(...)

#endif /* DEBUG */

extern STALogLevel ogaLogLevel;

FOUNDATION_EXPORT void STALogNSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2) NS_NO_TAIL_CALL;





@interface STALogSetting : NSObject

/**
 * 设置LST水平
 * param logLevel :
 * DEBUG builds 默认 STALogLevelAll
 * RELEASE builds 默认 STALogLevelWarn 和 STALogLevelError
 */
+ (void)setLogLevel:(STALogLevel)logLevel;

/**
 * 展示自定义控制台
 */
+ (void)showConsoleView;

@end
